# 最低版本要求
cmake_minimum_required(VERSION 3.10)

# 项目信息
project(yoloCpp)

# 设置调试选项
SET(CMAKE_BUILD_TYPE "Debug")
SET(CMAKE_CXX_FLAGS_DEBUG "$ENV{CXXFLAGS} -O0 -Wall -g2 -ggdb")
SET(CMAKE_CXX_FLAGS_RELEASE "$ENV{CXXFLAGS} -O3 -Wall")

set(root_PATH /home/luoluoluo/yoloCpp)

# 寻找Opencv库
find_package(OpenCV REQUIRED)
# 寻找ONNX库
set(ONNXRUNTIME_ROOT_PATH ${root_PATH}/3rdparty/onnxruntime)
set(ONNXRUNTIME_INCLUDE_DIRS ${root_PATH}/3rdparty/onnxruntime/include/onnxruntime/core/session)
set(ONNXRUNTIME_LIBS ${root_PATH}/3rdparty/onnxruntime/build/Linux/Release/libonnxruntime.so)
#第三方库
#自己的库
include_directories(${root_PATH}/include/hack ${root_PATH}/include/yolo ${root_PATH}/include/common ${ONNXRUNTIME_INCLUDE_DIRS})

# 添加可执行文件
add_executable(${PROJECT_NAME} src/mains/yoloCpp.cpp src/hack/BASEHACKREGION.cpp src/yolo/yolov7.cpp)

# 链接库
target_link_libraries(${PROJECT_NAME} ${OpenCV_LIBS} ${ONNXRUNTIME_LIBS} )
